package com.xjoyt.pay.gateway.services;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xjoyt.pay.abstracts.AbstractService;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.gateway.params.InvokeLogParam;
import com.xjoyt.pay.gateway.po.InvokeLog;
import com.xjoyt.pay.gateway.repository.InvokeLogRepository;

@Service
public class InvokeLogService extends AbstractService {

    @Autowired
    private InvokeLogRepository repository;

    public ExecuteResult<InvokeLog> save(InvokeLog entity) {
        entity.addedDate = new Date();
        repository.save(entity);
        return ExecuteResult.ok(entity);
    }

    public PageResult<InvokeLog> loadPage(PageParam<InvokeLogParam> param) {
        return repository.loadPage(param);
    }

}
